<?php
/**
 * Routes configuration
 *
 * In this file, you set up routes to your controllers and their actions.
 * Routes are very important mechanism that allows you to freely connect
 * different urls to chosen controllers and their actions (functions).
 *
 * PHP 5
 *
 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
 * Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
 *
 * Licensed under The MIT License
 * Redistributions of files must retain the above copyright notice.
 *
 * @copyright     Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
 * @link          http://cakephp.org CakePHP(tm) Project
 * @package       app.Config
 * @since         CakePHP(tm) v 0.2.9
 * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
 */
/**
 * Here, we are connecting '/' (base path) to controller called 'Pages',
 * its action called 'display', and we pass a param to select the view file
 * to use (in this case, /app/View/Pages/home.ctp)...
 */

$contentMap = Configure::read('App.contentPage');
	//Router::connect('/', array('controller' => 'pages', 'action' => 'display', 'home'));
Router::connect('/', array('controller' => 'contents', 'action' => 'filter', $contentMap['home']));
/**
 * ...and connect the rest of 'Pages' controller's urls.
 */
	Router::connect('/pages/*', array('controller' => 'pages', 'action' => 'display'));

  /** Custom Routes
   * http://bakery.cakephp.org/articles/Frank/2009/11/02/cakephp-s-routing-explained
   */

  Router::connect('/about-us/*', array('controller' => 'contents', 'action' => 'filter', $contentMap['ourclub']));
  Router::connect('/our-club/*', array('controller' => 'contents', 'action' => 'filter', $contentMap['ourclub']));

  Router::connect('/resources/*', array('controller' => 'contents', 'action' => 'filter', $contentMap['breeders']));
  Router::connect('/breeders/*', array('controller' => 'contents', 'action' => 'filter', $contentMap['breeders']));
  Router::connect('/classes/*', array('controller' => 'contents', 'action' => 'filter', $contentMap['classes']));

  Router::connect('/our-show/*', array('controller' => 'contents', 'action' => 'filter', $contentMap['ourshow']));
  Router::connect('/events/*', array('controller' => 'contents', 'action' => 'events',  $contentMap['events']));

  Router::connect('/contact-us/*', array('controller' => 'contact', 'action' => 'index', $contentMap['contactus']));
 
  Router::connect('/image-gallery', array('controller' => 'categories', 'action' => 'index'));

  Router::connect('/image-gallery-admin/*', array('controller' => 'categories', 'action' => 'main', "member"=>true));
  
  Router::connect('/login', array('controller' => 'security', 'action' => 'login'));
  Router::connect('/register', array('controller' => 'security', 'action' => 'register'));
  Router::connect('/register-member', array('controller' => 'security', 'action' => 'registerMember'));
  Router::connect('/forgot-password', array('controller' => 'security', 'action' => 'forgotPassword'));

  //members
  Router::connect('/member', array('controller' => 'contents', 'action' => 'home', "member"=>true));

  //admin
  Router::connect('/admin', array('controller' => 'contents', 'action' => 'home', "admin"=>true));

/**
 * Load all plugin routes.  See the CakePlugin documentation on 
 * how to customize the loading of plugin routes.
 */
	CakePlugin::routes();

/**
 * Load the CakePHP default routes. Remove this if you do not want to use
 * the built-in default routes.
 */
	require CAKE . 'Config' . DS . 'routes.php';
